﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterCP.master" AutoEventWireup="true" CodeBehind="VoteWebMasterRequests.aspx.cs" Inherits="University.Workshop.WebApp.VoteWebMasterRequests" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style=' margin-bottom:15px;background-color: #4b6c9e; color: White;'>
        <h4 style='margin-top: 4px; font-size: large; color: White; width: 615px;'>
           &nbsp;>Vote Webmaster Requests
        </h4>
    </div>
    <asp:MultiView runat="server" ID="MultiViewCanVoteRequests">
        <asp:View runat="server" ID="ShowRequests">
            <asp:MultiView runat="server" ID="MultiViewRequests">
                <asp:View runat="server" ID="AreRequests">
                <h3>
                Please select one request</h3>
                <asp:ScriptManager runat="server" ID="scriptMan"/>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div>
                <asp:DataList ID="dataListRequests" runat="server" OnItemCommand="DL_ItemCommand">
                    <HeaderTemplate>
                        <table style='border-collapse: collapse; border: 1; width="100%;'>
                            <thead bgcolor="#4b6c9e" style="font-weight: bold; color: white; font-size: medium;">
                                <td style='height: 25px; border-right: 1px white solid;'>
                                    User
                                </td>
                                <td style='border-right: 1px white solid; width: 90px;'>
                                    Date
                                </td>
                                <td style='border-right: 1px white solid; '>
                                    Positive Votes
                                </td>
                                <td style='border-right: 1px white solid; '>
                                    Negative Votes
                                </td>
                            </thead>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr style='color: Black; background-color: White; border: 1px #3A4F63 solid;' <%# TRJavaScript(Container) %>>
                            <td style='border-right: 1px #3A4F63 solid; height: 25px; font-size: medium;'>
                                <asp:Button Style="display: none;" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"Id")%>'
                                    CausesValidation="false" ID="HiddenButton" runat="server" Text="View"></asp:Button>
                                <asp:LinkButton ID="lnkBtnUser" PostBackUrl='<%# GetLinkUser(Eval("CandidateId")) %>'
                                    runat="server" Text='<%# GetUser(DataBinder.Eval(Container.DataItem,"CandidateId")) %>' />
                            </td>
                            <td style='border-right: 1px #3A4F63 solid; font-size: medium;'>
                                <%# DataBinder.Eval(Container.DataItem, "Date.Day")%>/<%# DataBinder.Eval(Container.DataItem, "Date.Month")%>/<%# DataBinder.Eval(Container.DataItem, "Date.Year")%></td>
                            <td style='border-right: 1px #3A4F63 solid;  font-size: medium; color: Green;'>
                                <%# DataBinder.Eval(Container.DataItem, "PositiveVotes")%>
                            </td>
                            <td style="height: 25px; font-size: medium; color: Red;">
                                <%# DataBinder.Eval(Container.DataItem, "NegativeVotes")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:DataList>
            </div>
            <div>
                <table>
                    <tr>
                        <td style='width: 120px'>
                        </td>
                        <td>
                            <h3 id="ShowContent" runat="server" style='margin-top: 0px'>
                                Showing
                            </h3>
                        </td>
                        <td>
                            <asp:Button runat="server" ID="PrevButton" Text="<- Prev." OnClick="PrevButton_Click" />
                        </td>
                        <td>
                            <asp:Button runat="server" ID="NextButton" Text="Next ->" OnClick="NextButton_Click" />
                        </td>
                    </tr>
                </table>
            </div>
            </ContentTemplate>
            </asp:UpdatePanel>
                </asp:View>
                <asp:View runat="server" ID="AreNotRequests">
                    <h4>There are no requests in voting!</h4>
                </asp:View>
            </asp:MultiView>
        </asp:View>
        <asp:View runat="server" ID="NoShowRequests">
            <h4>You have not required privileges to vote webmaster requests!</h4>
        </asp:View>
    </asp:MultiView>
</asp:Content>
